package cn.yzw.jc.sandbox.spring.domain;

import lombok.Data;

/**
 * @author liucan@yzw.cn write on 2024/1/8 15:14
 */
@Data
public class SpringBeanModel {
    /**
     * 实例名
     */
    private String beanName;
    /**
     * 类名
     */
    private String className;

//    /**
//     * classLoaderName
//     */
//    private String classLoaderName;

    /**
     * 开始时间
     */
    private Long startTime;
    /**
     * 结束时间
     */
    private Long finishTime;
    /**
     * 耗时
     */
    private Long cost;

    public void startTimer() {
        this.startTime = System.currentTimeMillis();
    }

    public void finishTimer() {
        this.finishTime = System.currentTimeMillis();
        if (startTime != null) {
            cost = finishTime - startTime;
        }
    }
}
